<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
  
    <link rel="stylesheet" type="text/css" href="/Public/admin/Css/bootstrap.min.css" />
     <link rel="stylesheet" type="text/css" href="/Public/admin/Css/ui.css" />
      <link rel="stylesheet" type="text/css" href="/Public/admin/Css/Admin-default.css" />
   
</head>
<body>
<div class="page-content-wrap">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="panel panel-default">
                                <div class="panel-body">
<form action="<?php echo U('Questionnaire/delete');?>" method="post">
<div class="table-tools">
    <button type="submit" class="btn btn-primary" title="删除勾选的问卷"><i class="glyphicon glyphicon-remove"></i> 删 除 </button>
    <a href="<?php echo U('Questionnaire/add');?>" class="btn btn-info" title="添加问卷"><i class="fa fa-copy"></i> 添 加 </a>
    <p>问卷列表</p>
</div>

<table id="questionnaire-table" class="table table-striped table-hover table-condensed datatable">
    <thead>
        <tr>
            <th>序号</th>
            <th>类型</th>
            <th>名称</th>
            <th>描述</th>
            <th>创建日期</th>
            <th>失效日期</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
    	<?php if(is_array($questionnaires)): $i = 0; $__LIST__ = $questionnaires;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$questionnaire): $mod = ($i % 2 );++$i;?><tr>
    			<td><input name='id[]' type="checkbox" value="<?php echo ($questionnaire["id"]); ?>" /> <?php echo ($i); ?></td>
    			<td>
                            <span class="label label-danger"><i class="fa fa-tag"></i><?php echo ($questionnaire["type"]); ?></span>
                     
    			</td>
    			<td class="questionnaire_name"><?php echo ($questionnaire["name"]); ?></td>
    			<td class="questionnaire_desc"><?php echo (mb_substr($questionnaire["description"],0,30,'utf-8')); ?>...</td>
    			<td><?php echo ($questionnaire["create_date"]); ?></td>
    			<td><?php echo ($questionnaire["expire_date"]); ?></td>
    			<td>
                    <a href="<?php echo U('Questionnaire/edit', array('id' => $questionnaire['id']));?>" class="btn btn-default btn-rounded btn-condensed btn-sm" title="编辑问卷"><span class="fa fa-pencil"></span>
                    </a>
                    <a href="<?php echo U('Questions/index', array('questionnaire_id' => $questionnaire['id']));?>" class="btn btn-default btn-rounded btn-condensed btn-sm" title="问卷配题"><span class="fa fa-list-ul"></span></a>
                    <a href="<?php echo U('Questionnaire/delete', array('id' => $questionnaire['id']));?>" class="btn btn-danger btn-rounded btn-condensed btn-sm" title="删除问卷"><span class="fa fa-times"></span></a>
    			</td>
    		</tr><?php endforeach; endif; else: echo "" ;endif; ?>
    </tbody>
</table>
</form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>